diff options
Diffstat (limited to 'src/app/anime/[id]/[...animeId]')
| -rw-r--r-- | src/app/anime/[id]/[...animeId]/page.jsx | 13 | ||||
| -rw-r--r-- | src/app/anime/[id]/[...animeId]/video.module.css | 7 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/app/anime/[id]/[...animeId]/page.jsx b/src/app/anime/[id]/[...animeId]/page.jsx index 966f212..950f618 100644 --- a/src/app/anime/[id]/[...animeId]/page.jsx +++ b/src/app/anime/[id]/[...animeId]/page.jsx @@ -10,6 +10,7 @@ import { redirect } from "next/navigation"; import Link from "next/link"; export default async function Video({ params }) { + let link; const id = params.animeId[0]; const series = params.animeId[1]; @@ -25,7 +26,16 @@ export default async function Video({ params }) { redirect("/404"); } - const link = data.sources[4].url; + try { + link = data.sources[4].url; + } catch (error) { + try { + link = data.sources[3].url; + } catch (error) { + console.log("Episode not found."); + redirect("/404"); + } + } return ( <div className={styles.VideoMain}> @@ -37,7 +47,6 @@ export default async function Video({ params }) { <MediaPlayer title={words} src={link} - playsInline aspectRatio="16/9" load="eager" className={styles.VideoPlayer} diff --git a/src/app/anime/[id]/[...animeId]/video.module.css b/src/app/anime/[id]/[...animeId]/video.module.css index d947fc3..0214e60 100644 --- a/src/app/anime/[id]/[...animeId]/video.module.css +++ b/src/app/anime/[id]/[...animeId]/video.module.css @@ -1,8 +1,3 @@ -.VideoMain { - max-width: 98%; - margin: 0px auto; -} - .Video { display: flex; justify-content: center; @@ -11,7 +6,7 @@ .VideoPlayer { border-radius: 10px; - width: 75%; + width: 70%; height: auto; } |